/*
 * CommandsModuleBridgeFromTextFile.h
 *
 *  Created on: Dec 12, 2014
 *      Authors: Avihay Avitan & Stefan Farcas
 */

#ifndef COMMANDSMODULEBRIDGEFROMTEXTFILE_H_
#define COMMANDSMODULEBRIDGEFROMTEXTFILE_H_

#include "CommandsModuleBridge.h"
#include "../TextFileParser/CommandsTextFileParser.h"
#include <re2/re2.h>

using namespace TextFileParserSpace;

namespace CommandsModuleBridgeSpace {
/**
 * CommandsModuleBridgeFromTextFile is an implementation of CommandsModuleBridge interface, defined to load commands to satellite from text file or creating them by code
 */

class CommandsModuleBridgeFromTextFile: public CommandsModuleBridge {
public:
	CommandsModuleBridgeFromTextFile();
	virtual ~CommandsModuleBridgeFromTextFile();
	bool loadUplinkCommands(PassVector * pass);
	/**
	 * set the text file parser,  return true if success to parse file
	 */
	bool setTextFileParser(ITextFileParser * parser);

private:
	bool parseFile();
	bool loadCommandsOfPass(PassVector * pass);

	CommandsTextFileParser * parser;
	vector<SatelliteUplinkCommand * > * parsedCommands;
	int satCount;


};

} /* namespace CommandsModuleBridge */

#endif /* COMMANDSMODULEBRIDGEFROMTEXTFILE_H_ */
